﻿#region Using Directives

    using System;

    using Csla;

    using MarketPulse.BusinessLogic.Core;
    using MarketPulse.BusinessLogic.Common.Criteria;

#endregion

namespace MarketPulse.BusinessLogic.Common
{
    /// <summary>
    /// This class represents a collection of Enquiry that are delivered as part of a program
    /// </summary>
    [Serializable]
    [Csla.Server.ObjectFactory("MarketPulse.DataAccess.Factory.EnquiryFactory, MarketPulse.DataAccess.Factory", "CreateList", "FetchList")]
    public class EnquiryList : MarketPulseListBase<EnquiryList, Enquiry>
    {
        #region Constructors

            /// <summary>
            /// Default constructor is private in order to (try to) enforce construction
            /// only via the static factory methods provided.
            /// </summary>
            private EnquiryList()
            {
            }

        #endregion

        #region Methods

            #region Factory Methods

                /// <summary>
                /// Method used to create a new collection of Enquiry objects (via the DataPortal client proxy)
                /// </summary>
                /// <returns>The newly created collection of Enquiry objects</returns>
                internal static EnquiryList New()
                {
                    return DataPortal.Create<EnquiryList>();
                }

                /// <summary>
                /// Method used to get a list of read only Enquiries that are associated with a particular Profile and Company (via the DataPortal client proxy)
                /// </summary>
                /// <param name="profileGuid">The Profile Guid used to retrieve the visit list</param>
                /// /// <param name="companyGuid">The Company Guid used to retrieve the visit list</param>
                /// <returns>The populated list of visits</returns>
                public static EnquiryList GetByProfileGUIDAndCompanyGUID(Guid profileGuid, Guid companyGuid)
                {
                    return DataPortal.Fetch<EnquiryList>(new EnquiryCriteria(profileGuid, companyGuid));
                }

            #endregion

        #endregion
    }
}
